home *** CD-ROM | disk | FTP | other *** search
- /* File: PStrLib.h */
-
- #ifndef _PStrLib_
- #define _PStrLib_
- #ifndef _WindowMgr_
- #include <WindowMgr.h>
- #endif
- #ifndef _FontMgr_
- #include <FontMgr.h>
- #endif
- #ifndef _saneh_
- #include <sane.h>
- #endif
- extern char _char[];
- #define BOOL 1
- #define CDBL FFEXT
- #define CSHORTDBL FFDBL
- #define CFLOAT FFSGL
- #define CINT FFINT
- #define CLONG FFLNG
- #define CCOMP FFCOMP
- #define PSTR 2
- #define DEC FIXEDDECIMAL
- #define SCI FLOATDECIMAL
- #define ALL 255
- #define NIL 0L
- #define CEN (-1)
- #define NL1 (-1)
- #define NL2 (-2)
- #define CUR (-3)
- #define plain ''
- #define _alpha 1
- #define _digit 2
- #define _hex 4
- #define _octal 8
- #define _ascii 16
- #define _cntrl 32
- #define _punct 64
- #define _space 128
- /* The c character passed to the macros below should be
- 'declared as' or 'cast to' type 'Byte' or 'unsigned char'.
- Type char gets sign extended to an integer. Thus, when c > 127
- the _char[] subscript becomes negative! Note that immediate
- chars such as '•' do not get sign extended so they're okay.
- */
- #define IsAlphaNum(c) (_char[(c)+1]&(_alpha|_digit))
- #define IsAlpha(c) (_char[(c)+1]&_alpha)
- #define IsAscii(c) (_char[(c)+1]&_ascii)
- #define IsCntrl(c) (_char[(c)+1]&_cntrl)
- #define IsCSym(c) ((_char[(c)+1]&(_alpha|_digit))||(c)=='_')
- #define IsCSymF(c) ((_char[(c)+1]&_alpha)||(c)=='_')
- #define IsDigit(c) (_char[(c)+1]&_digit)
- #define IsGraph(c) ((c)>='!'&&(c)<='~')
- #define IsOctDigit(c) (_char[(c)+1]&_octal)
- #define IsPrint(c) ((c)>=32&&(c)<=255)
- #define IsPunct(c) (_char[(c)+1]&_punct)
- #define IsSpace(c) (_char[(c)+1]&_space)
- #define IsHexDigit(c) (_char[(c)+1]&_hex)
- #endif
-